#ifndef _MW_SOCKET_H_INCLUDED_
#define _MW_SOCKET_H_INCLUDED_

#include "mw_config.h"

int tcp_listen(const char *host, const char *serv);
int mw_nonblocking(int s);
int mw_blocking(int s);

#define mw_nonblocking_n   "ioctl(FIONBIO)"
#define mw_blocking_n      "ioctl(!FIONBIO)"

int mw_tcp_nopush(int s);
int mw_tcp_push(int s);

#if (__linux__)

#define mw_tcp_nopush_n   "setsockopt(TCP_CORK)"
#define mw_tcp_push_n     "setsockopt(!TCP_CORK)"

#else

#define mw_tcp_nopush_n   "setsockopt(TCP_NOPUSH)"
#define mw_tcp_push_n     "setsockopt(!TCP_NOPUSH)"

#endif


#endif /* _MW_SOCKET_H_INCLUDED_ */
